package com.fourfinance.model.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fourfinance.model.dao.LoanDAO;
import com.fourfinance.model.domain.Loan;
import com.fourfinance.model.service.LoanService;

@Service
public class LoanServiceImpl implements LoanService {
	
	@Autowired
	private LoanDAO loanDAO;

	@Transactional
	public Long add(Loan loan) {
		return loanDAO.add(loan);
	}

	@Transactional
	public Loan get(Long id) {
		return loanDAO.get(id);
	}

	@Transactional
	public List<Loan> list() {
		return loanDAO.list();
	}

	@Transactional
	public void remove(Long id) {
		loanDAO.remove(id);
	}

	@Transactional
	public void removeAll() {
		loanDAO.removeAll();		
	}

}
